package com.example.demo.xml;

import com.example.demo.entity.Request;
import com.example.demo.entity.Vehicle;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;

import java.util.ArrayList;
import java.util.List;

public class XmlDemoTest{

    public static void main(String[] args) {
        /*Vehicle vehicle = new Vehicle();
        vehicle.setCarColor("1");
        vehicle.setCarType("2");
        vehicle.setPhoto("3");
        vehicle.setVehicleCode("4");*/
        Result result = new Result();
        result.setErrmsg("Success.");
        result.setCode("0");

        Result result1 = new Result();
        result1.setErrmsg("Success.");
        result1.setCode("0");
        AlgorithmResult algorithmResult = new AlgorithmResult();
        algorithmResult.setTotal("0");
        algorithmResult.setAlgorithmCode("0202000100");
        List<AlgorithmResult> algorithmResults = new ArrayList<>();
        algorithmResults.add(algorithmResult);
        DomainResult domainResult = new DomainResult();
        domainResult.setResult(result);
        domainResult.setAlgorithmCode("0208000400");
        domainResult.setDomainCode("eaaea1d210f44b1bb6ee25ad61045fd1");
        List<DomainResult> domainResults = new ArrayList<>();
        domainResults.add(domainResult);
        Response response = new Response();
        response.setResult(result1);
        response.setAlgorithmResults(algorithmResults);
        response.setDomainResults(domainResults);
        response.setTotal("0");


        String xml = serialize(response);

        System.out.println(xml);
        System.out.println("-------------------------");
        String myXml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" +
                "<response>\n" +
                "    <result>\n" +
                "        <errmsg>success</errmsg>\n" +
                "        <code>0</code>\n" +
                "    </result>\n" +
                "    <domainResults>\n" +
                "        <domainResult>\n" +
                "            <algorithmCode></algorithmCode>\n" +
                "            <domainCode>eaaea1d210f44b1bb6ee25ad61045fd1</domainCode>\n" +
                "            <result>\n" +
                "                <errmsg>m search success</errmsg>\n" +
                "                <code>0</code>\n" +
                "            </result>\n" +
                "        </domainResult>\n" +
                "    </domainResults>\n" +
                "    <total>10515391</total>\n" +
                "    <algorithmResults>\n" +
                "        <algorithmResult>\n" +
                "            <algorithmCode></algorithmCode>\n" +
                "            <total>10515391</total>\n" +
                "            <faces>\n" +
                "                <face>\n" +
                "                    <commonInfo>\n" +
                "                        <cameraCNCode>02703731187922400000</cameraCNCode>\n" +
                "                        <cameraName>172.21.4.22</cameraName>\n" +
                "                        <cameraSn>02703731187922400101#d43bf160787446258131d95e1173b418</cameraSn>\n" +
                "                        <domainCode>eaaea1d210f44b1bb6ee25ad61045fd1</domainCode>\n" +
                "                        <domainName>eaaea1d210f44b1bb6ee25ad61045fd1</domainName>\n" +
                "                        <historyFileId></historyFileId>\n" +
                "                        <latitude>0.0</latitude>\n" +
                "                        <longitude>0.0</longitude>\n" +
                "                        <recordTime>1609430400016</recordTime>\n" +
                "                        <sourceDevice>1</sourceDevice>\n" +
                "                        <sourceDomain>eaaea1d210f44b1bb6ee25ad61045fd1</sourceDomain>\n" +
                "                    </commonInfo>\n" +
                "                    <extensionObjects>\n" +
                "                        <extensionField>\n" +
                "                            <value></value>\n" +
                "                        </extensionField>\n" +
                "                    </extensionObjects>\n" +
                "                    <pictureInfo>\n" +
                "                        <fileId>eaaea1d210f44b1bb6ee25ad61045fd1#8959906499593273352</fileId>\n" +
                "                        <picUrl>https://172.17.14.30:1190/mp_mcss/vcn-image.do?fileUuid=172.17.14.30-1189-2207375bfba242aca46cb161ee983e0d-MDIjMDAwMSPM%252FSL%252Bv%252B77LXpdhAghJAVknyEYcY%252BsL3XDQN9wBiRFV0UvOHlxSytoY2F5c3JKd20xUUN3PT0%253D</picUrl>\n" +
                "                        <pos>\n" +
                "                            <bottom>194</bottom>\n" +
                "                            <left>846</left>\n" +
                "                            <right>946</right>\n" +
                "                            <top>92</top>\n" +
                "                        </pos>\n" +
                "                        <quality>100</quality>\n" +
                "                        <thirdUrl></thirdUrl>\n" +
                "                        <thumPicUrl>https://172.17.14.30:1190/mp_mcss/vcn-image.do?fileUuid=172.17.14.30-1189-2207375bfba242aca46cb161ee983e0d-MDIjMDAwMSPKnv%252B%252BqVGefRl15Y2eNUg9FjzuzSe2Ax79D3HhTCRjdXV6ei9jVjBQSHdLRE1CVVdKdjhRPT0%253D</thumPicUrl>\n" +
                "                    </pictureInfo>\n" +
                "                    <faceAttributes>\n" +
                "                        <gImgCntId>027037311879224000000220210101000003205490616052</gImgCntId>\n" +
                "                        <mouthmask>2</mouthmask>\n" +
                "                    </faceAttributes>\n" +
                "                </face>\n" +
                "                <face>\n" +
                "                    <commonInfo>\n" +
                "                        <cameraCNCode>02703731187744430000</cameraCNCode>\n" +
                "                        <cameraName>172.21.4.18</cameraName>\n" +
                "                        <cameraSn>02703731187744430101#d43bf160787446258131d95e1173b418</cameraSn>\n" +
                "                        <domainCode>eaaea1d210f44b1bb6ee25ad61045fd1</domainCode>\n" +
                "                        <domainName>eaaea1d210f44b1bb6ee25ad61045fd1</domainName>\n" +
                "                        <historyFileId></historyFileId>\n" +
                "                        <latitude>0.0</latitude>\n" +
                "                        <longitude>0.0</longitude>\n" +
                "                        <recordTime>1609430400407</recordTime>\n" +
                "                        <sourceDevice>1</sourceDevice>\n" +
                "                        <sourceDomain>eaaea1d210f44b1bb6ee25ad61045fd1</sourceDomain>\n" +
                "                    </commonInfo>\n" +
                "                    <extensionObjects>\n" +
                "                        <extensionField>\n" +
                "                            <value></value>\n" +
                "                        </extensionField>\n" +
                "                    </extensionObjects>\n" +
                "                    <pictureInfo>\n" +
                "                        <fileId>eaaea1d210f44b1bb6ee25ad61045fd1#2060391870453284865</fileId>\n" +
                "                        <picUrl>https://172.17.14.30:1190/mp_mcss/vcn-image.do?fileUuid=172.17.14.30-1179-f31a27fce7e7477b858ff3d0bd3dd542-MDIjMDAwMSNTrl21YkCdNmjtjreyiGUVBBLTwA5pZ1YKoPbvMiQ4UFBBZjBmODEvS0FkMWw5Zy8wcjF3PT0%253D</picUrl>\n" +
                "                        <pos>\n" +
                "                            <bottom>307</bottom>\n" +
                "                            <left>815</left>\n" +
                "                            <right>846</right>\n" +
                "                            <top>274</top>\n" +
                "                        </pos>\n" +
                "                        <quality>100</quality>\n" +
                "                        <thirdUrl></thirdUrl>\n" +
                "                        <thumPicUrl>https://172.17.14.30:1190/mp_mcss/vcn-image.do?fileUuid=172.17.14.30-1179-f31a27fce7e7477b858ff3d0bd3dd542-MDIjMDAwMSOnzjr7HdjGduTSgjr2hREW8dkn4%252FhdN7CZ%252FJTfMyRPblFNcUZsNXpJUElyaTROQWhQeXJ3PT0%253D</thumPicUrl>\n" +
                "                    </pictureInfo>\n" +
                "                    <faceAttributes>\n" +
                "                        <gImgCntId>027037311877444300000220210101000001205410616044</gImgCntId>\n" +
                "                        <mouthmask>2</mouthmask>\n" +
                "                    </faceAttributes>\n" +
                "                </face>\n" +
                "                <face>\n" +
                "                    <commonInfo>\n" +
                "                        <cameraCNCode>02703731184616460000</cameraCNCode>\n" +
                "                        <cameraName>172.21.4.29</cameraName>\n" +
                "                        <cameraSn>02703731184616460101#d43bf160787446258131d95e1173b418</cameraSn>\n" +
                "                        <domainCode>eaaea1d210f44b1bb6ee25ad61045fd1</domainCode>\n" +
                "                        <domainName>eaaea1d210f44b1bb6ee25ad61045fd1</domainName>\n" +
                "                        <historyFileId></historyFileId>\n" +
                "                        <latitude>0.0</latitude>\n" +
                "                        <longitude>0.0</longitude>\n" +
                "                        <recordTime>1609430400637</recordTime>\n" +
                "                        <sourceDevice>1</sourceDevice>\n" +
                "                        <sourceDomain>eaaea1d210f44b1bb6ee25ad61045fd1</sourceDomain>\n" +
                "                    </commonInfo>\n" +
                "                    <extensionObjects>\n" +
                "                        <extensionField>\n" +
                "                            <value></value>\n" +
                "                        </extensionField>\n" +
                "                    </extensionObjects>\n" +
                "                    <pictureInfo>\n" +
                "                        <fileId>eaaea1d210f44b1bb6ee25ad61045fd1#5789372361928638473</fileId>\n" +
                "                        <picUrl>https://172.17.14.30:1190/mp_mcss/vcn-image.do?fileUuid=172.17.14.30-1179-f31a27fce7e7477b858ff3d0bd3dd542-MDIjMDAwMSPwLpTI41pek0%252BoLmWEMpINioNYbt%252BH%252FjVGH3e1%252FiRrZE9SZHpEaWhLZ0s5MDQ4QVZTV013PT0%253D</picUrl>\n" +
                "                        <pos>\n" +
                "                            <bottom>113</bottom>\n" +
                "                            <left>581</left>\n" +
                "                            <right>668</right>\n" +
                "                            <top>33</top>\n" +
                "                        </pos>\n" +
                "                        <quality>99</quality>\n" +
                "                        <thirdUrl></thirdUrl>\n" +
                "                        <thumPicUrl>https://172.17.14.30:1190/mp_mcss/vcn-image.do?fileUuid=172.17.14.30-1179-f31a27fce7e7477b858ff3d0bd3dd542-MDIjMDAwMSMQobMMyz%252Blz1iegyLrOJ%252FsSHSLlUuVWIREqwiX3SROTTFrQmdOUm54bFVPK2RjUFhoNkhRPT0%253D</thumPicUrl>\n" +
                "                    </pictureInfo>\n" +
                "                    <faceAttributes>\n" +
                "                        <gImgCntId>027037311846164600000220210101000004206130616016</gImgCntId>\n" +
                "                        <mouthmask>1</mouthmask>\n" +
                "                    </faceAttributes>\n" +
                "                </face>\n" +
                "                <face>\n" +
                "                    <commonInfo>\n" +
                "                        <cameraCNCode>02703731187744430000</cameraCNCode>\n" +
                "                        <cameraName>172.21.4.18</cameraName>\n" +
                "                        <cameraSn>02703731187744430101#d43bf160787446258131d95e1173b418</cameraSn>\n" +
                "                        <domainCode>eaaea1d210f44b1bb6ee25ad61045fd1</domainCode>\n" +
                "                        <domainName>eaaea1d210f44b1bb6ee25ad61045fd1</domainName>\n" +
                "                        <historyFileId></historyFileId>\n" +
                "                        <latitude>0.0</latitude>\n" +
                "                        <longitude>0.0</longitude>\n" +
                "                        <recordTime>1609430400675</recordTime>\n" +
                "                        <sourceDevice>1</sourceDevice>\n" +
                "                        <sourceDomain>eaaea1d210f44b1bb6ee25ad61045fd1</sourceDomain>\n" +
                "                    </commonInfo>\n" +
                "                    <extensionObjects>\n" +
                "                        <extensionField>\n" +
                "                            <value></value>\n" +
                "                        </extensionField>\n" +
                "                    </extensionObjects>\n" +
                "                    <pictureInfo>\n" +
                "                        <fileId>eaaea1d210f44b1bb6ee25ad61045fd1#2096420667484831745</fileId>\n" +
                "                        <picUrl>https://172.17.14.30:1190/mp_mcss/vcn-image.do?fileUuid=172.17.14.30-1179-f31a27fce7e7477b858ff3d0bd3dd542-MDIjMDAwMSPtk8Weh6Zx2RaKbJOlJZPYCRoBgk%252BqlSfiwFOuwyQ4TVRmZWtXZjU3RWpkb29neEVqKzRBPT0%253D</picUrl>\n" +
                "                        <pos>\n" +
                "                            <bottom>356</bottom>\n" +
                "                            <left>1369</left>\n" +
                "                            <right>1403</right>\n" +
                "                            <top>324</top>\n" +
                "                        </pos>\n" +
                "                        <quality>100</quality>\n" +
                "                        <thirdUrl></thirdUrl>\n" +
                "                        <thumPicUrl>https://172.17.14.30:1190/mp_mcss/vcn-image.do?fileUuid=172.17.14.30-1179-f31a27fce7e7477b858ff3d0bd3dd542-MDIjMDAwMSMNCxjQHzVoBBg%252FfxHuoiKP1s2H40PuJfFvO9BpAiRZeWd6Q3E4YklqMFpDTTB6SEVDdXVRPT0%253D</thumPicUrl>\n" +
                "                    </pictureInfo>\n" +
                "                    <faceAttributes>\n" +
                "                        <gImgCntId>027037311877444300000220210101000004205810616084</gImgCntId>\n" +
                "                        <mouthmask>2</mouthmask>\n" +
                "                    </faceAttributes>\n" +
                "                </face>\n" +
                "                <face>\n" +
                "                    <commonInfo>\n" +
                "                        <cameraCNCode>02703731184616460000</cameraCNCode>\n" +
                "                        <cameraName>172.21.4.29</cameraName>\n" +
                "                        <cameraSn>02703731184616460101#d43bf160787446258131d95e1173b418</cameraSn>\n" +
                "                        <domainCode>eaaea1d210f44b1bb6ee25ad61045fd1</domainCode>\n" +
                "                        <domainName>eaaea1d210f44b1bb6ee25ad61045fd1</domainName>\n" +
                "                        <historyFileId></historyFileId>\n" +
                "                        <latitude>0.0</latitude>\n" +
                "                        <longitude>0.0</longitude>\n" +
                "                        <recordTime>1609430400722</recordTime>\n" +
                "                        <sourceDevice>1</sourceDevice>\n" +
                "                        <sourceDomain>eaaea1d210f44b1bb6ee25ad61045fd1</sourceDomain>\n" +
                "                    </commonInfo>\n" +
                "                    <extensionObjects>\n" +
                "                        <extensionField>\n" +
                "                            <value></value>\n" +
                "                        </extensionField>\n" +
                "                    </extensionObjects>\n" +
                "                    <pictureInfo>\n" +
                "                        <fileId>eaaea1d210f44b1bb6ee25ad61045fd1#5681285970859163657</fileId>\n" +
                "                        <picUrl>https://172.17.14.30:1190/mp_mcss/vcn-image.do?fileUuid=172.17.14.30-1179-f31a27fce7e7477b858ff3d0bd3dd542-MDIjMDAwMSOvvvNRUt%252Ft2qPf5zSS00%252BjCuDSFDb6khlsOSneYyRpT1kxcnFmNm1RL3NxTVN4aDFRZlV3PT0%253D</picUrl>\n" +
                "                        <pos>\n" +
                "                            <bottom>1040</bottom>\n" +
                "                            <left>391</left>\n" +
                "                            <right>660</right>\n" +
                "                            <top>799</top>\n" +
                "                        </pos>\n" +
                "                        <quality>99</quality>\n" +
                "                        <thirdUrl></thirdUrl>\n" +
                "                        <thumPicUrl>https://172.17.14.30:1190/mp_mcss/vcn-image.do?fileUuid=172.17.14.30-1179-f31a27fce7e7477b858ff3d0bd3dd542-MDIjMDAwMSOQ7qY1rBSEwkuxpP1jcXwOJPtx9Ptm10dy0iZDOSRxRjczQ3JneUYyZHV0U1EyUjY1TG9BPT0%253D</thumPicUrl>\n" +
                "                    </pictureInfo>\n" +
                "                    <faceAttributes>\n" +
                "                        <gImgCntId>027037311846164600000220210101000001205290616032</gImgCntId>\n" +
                "                        <mouthmask>2</mouthmask>\n" +
                "                    </faceAttributes>\n" +
                "                </face>\n" +
                "                <face>\n" +
                "                    <commonInfo>\n" +
                "                        <cameraCNCode>02703731184616460000</cameraCNCode>\n" +
                "                        <cameraName>172.21.4.29</cameraName>\n" +
                "                        <cameraSn>02703731184616460101#d43bf160787446258131d95e1173b418</cameraSn>\n" +
                "                        <domainCode>eaaea1d210f44b1bb6ee25ad61045fd1</domainCode>\n" +
                "                        <domainName>eaaea1d210f44b1bb6ee25ad61045fd1</domainName>\n" +
                "                        <historyFileId></historyFileId>\n" +
                "                        <latitude>0.0</latitude>\n" +
                "                        <longitude>0.0</longitude>\n" +
                "                        <recordTime>1609430400722</recordTime>\n" +
                "                        <sourceDevice>1</sourceDevice>\n" +
                "                        <sourceDomain>eaaea1d210f44b1bb6ee25ad61045fd1</sourceDomain>\n" +
                "                    </commonInfo>\n" +
                "                    <extensionObjects>\n" +
                "                        <extensionField>\n" +
                "                            <value></value>\n" +
                "                        </extensionField>\n" +
                "                    </extensionObjects>\n" +
                "                    <pictureInfo>\n" +
                "                        <fileId>eaaea1d210f44b1bb6ee25ad61045fd1#5771357963419156489</fileId>\n" +
                "                        <picUrl>https://172.17.14.30:1190/mp_mcss/vcn-image.do?fileUuid=172.17.14.30-1179-f31a27fce7e7477b858ff3d0bd3dd542-MDIjMDAwMSM25xLLUbZzs2lkSB0kOmEHvPU0C64NDPDRERHf%252FSRTY0FkRmdkM3hpb2I4c3hBNitqSEFBPT0%253D</picUrl>\n" +
                "                        <pos>\n" +
                "                            <bottom>267</bottom>\n" +
                "                            <left>935</left>\n" +
                "                            <right>1066</right>\n" +
                "                            <top>144</top>\n" +
                "                        </pos>\n" +
                "                        <quality>99</quality>\n" +
                "                        <thirdUrl></thirdUrl>\n" +
                "                        <thumPicUrl>https://172.17.14.30:1190/mp_mcss/vcn-image.do?fileUuid=172.17.14.30-1179-f31a27fce7e7477b858ff3d0bd3dd542-MDIjMDAwMSM6kbzMuO5ABQMxNCVquzLgKHYV%252BvnCNQKgBlDf7SRBSlMwUVp0SHNmUmlsaVZnOUpIQ21BPT0%253D</thumPicUrl>\n" +
                "                    </pictureInfo>\n" +
                "                    <faceAttributes>\n" +
                "                        <gImgCntId>027037311846164600000220210101000004206170616020</gImgCntId>\n" +
                "                        <mouthmask>2</mouthmask>\n" +
                "                    </faceAttributes>\n" +
                "                </face>\n" +
                "                <face>\n" +
                "                    <commonInfo>\n" +
                "                        <cameraCNCode>02703731184616460000</cameraCNCode>\n" +
                "                        <cameraName>172.21.4.29</cameraName>\n" +
                "                        <cameraSn>02703731184616460101#d43bf160787446258131d95e1173b418</cameraSn>\n" +
                "                        <domainCode>eaaea1d210f44b1bb6ee25ad61045fd1</domainCode>\n" +
                "                        <domainName>eaaea1d210f44b1bb6ee25ad61045fd1</domainName>\n" +
                "                        <historyFileId></historyFileId>\n" +
                "                        <latitude>0.0</latitude>\n" +
                "                        <longitude>0.0</longitude>\n" +
                "                        <recordTime>1609430401061</recordTime>\n" +
                "                        <sourceDevice>1</sourceDevice>\n" +
                "                        <sourceDomain>eaaea1d210f44b1bb6ee25ad61045fd1</sourceDomain>\n" +
                "                    </commonInfo>\n" +
                "                    <extensionObjects>\n" +
                "                        <extensionField>\n" +
                "                            <value></value>\n" +
                "                        </extensionField>\n" +
                "                    </extensionObjects>\n" +
                "                    <pictureInfo>\n" +
                "                        <fileId>eaaea1d210f44b1bb6ee25ad61045fd1#5735329166395998217</fileId>\n" +
                "                        <picUrl>https://172.17.14.30:1190/mp_mcss/vcn-image.do?fileUuid=172.17.14.30-1179-f31a27fce7e7477b858ff3d0bd3dd542-MDIjMDAwMSPk%252BA%252F6hGA2%252FbFfjtxMq6w7mjJqSBU%252Bo94Dj%252BHijSQ0dm9hZCt0cGlkTnF1WW9UbjVuUVZ3PT0%253D</picUrl>\n" +
                "                        <pos>\n" +
                "                            <bottom>160</bottom>\n" +
                "                            <left>788</left>\n" +
                "                            <right>871</right>\n" +
                "                            <top>68</top>\n" +
                "                        </pos>\n" +
                "                        <quality>100</quality>\n" +
                "                        <thirdUrl></thirdUrl>\n" +
                "                        <thumPicUrl>https://172.17.14.30:1190/mp_mcss/vcn-image.do?fileUuid=172.17.14.30-1179-f31a27fce7e7477b858ff3d0bd3dd542-MDIjMDAwMSMqN3BjFCOkLWHFEUKOB84yriX7%252Fm0o6Y%252BnlyjAOSRoZS90cWgrdllIRHBnbm0rSkh5RTRnPT0%253D</thumPicUrl>\n" +
                "                    </pictureInfo>\n" +
                "                    <faceAttributes>\n" +
                "                        <gImgCntId>027037311846164600000220210101000003205650616068</gImgCntId>\n" +
                "                        <mouthmask>2</mouthmask>\n" +
                "                    </faceAttributes>\n" +
                "                </face>\n" +
                "                <face>\n" +
                "                    <commonInfo>\n" +
                "                        <cameraCNCode>02703731187744430000</cameraCNCode>\n" +
                "                        <cameraName>172.21.4.18</cameraName>\n" +
                "                        <cameraSn>02703731187744430101#d43bf160787446258131d95e1173b418</cameraSn>\n" +
                "                        <domainCode>eaaea1d210f44b1bb6ee25ad61045fd1</domainCode>\n" +
                "                        <domainName>eaaea1d210f44b1bb6ee25ad61045fd1</domainName>\n" +
                "                        <historyFileId></historyFileId>\n" +
                "                        <latitude>0.0</latitude>\n" +
                "                        <longitude>0.0</longitude>\n" +
                "                        <recordTime>1609430401076</recordTime>\n" +
                "                        <sourceDevice>1</sourceDevice>\n" +
                "                        <sourceDomain>eaaea1d210f44b1bb6ee25ad61045fd1</sourceDomain>\n" +
                "                    </commonInfo>\n" +
                "                    <extensionObjects>\n" +
                "                        <extensionField>\n" +
                "                            <value></value>\n" +
                "                        </extensionField>\n" +
                "                    </extensionObjects>\n" +
                "                    <pictureInfo>\n" +
                "                        <fileId>eaaea1d210f44b1bb6ee25ad61045fd1#2204507058554306561</fileId>\n" +
                "                        <picUrl>https://172.17.14.30:1190/mp_mcss/vcn-image.do?fileUuid=172.17.14.30-1179-f31a27fce7e7477b858ff3d0bd3dd542-MDIjMDAwMSOzebOpaXTebaCKyTz5aL9YWIX4FeGjjlJpUPDTOyR1dTFiOWttRFpGaXdXREhPM3FBT0lnPT0%253D</picUrl>\n" +
                "                        <pos>\n" +
                "                            <bottom>388</bottom>\n" +
                "                            <left>1549</left>\n" +
                "                            <right>1582</right>\n" +
                "                            <top>354</top>\n" +
                "                        </pos>\n" +
                "                        <quality>100</quality>\n" +
                "                        <thirdUrl></thirdUrl>\n" +
                "                        <thumPicUrl>https://172.17.14.30:1190/mp_mcss/vcn-image.do?fileUuid=172.17.14.30-1179-f31a27fce7e7477b858ff3d0bd3dd542-MDIjMDAwMSOqRWmZQz5tpW8a9A%252FROGeQ7duiCxz2%252Bs6VTSifeSRoMU42c2ZOemt3WkNObVBFK1RGdHpBPT0%253D</thumPicUrl>\n" +
                "                    </pictureInfo>\n" +
                "                    <faceAttributes>\n" +
                "                        <gImgCntId>027037311877444300000220210101000007206770616080</gImgCntId>\n" +
                "                        <mouthmask>2</mouthmask>\n" +
                "                    </faceAttributes>\n" +
                "                </face>\n" +
                "                <face>\n" +
                "                    <commonInfo>\n" +
                "                        <cameraCNCode>02703731183694600000</cameraCNCode>\n" +
                "                        <cameraName>172.21.4.52</cameraName>\n" +
                "                        <cameraSn>02703731183694600101#d43bf160787446258131d95e1173b418</cameraSn>\n" +
                "                        <domainCode>eaaea1d210f44b1bb6ee25ad61045fd1</domainCode>\n" +
                "                        <domainName>eaaea1d210f44b1bb6ee25ad61045fd1</domainName>\n" +
                "                        <historyFileId></historyFileId>\n" +
                "                        <latitude>0.0</latitude>\n" +
                "                        <longitude>0.0</longitude>\n" +
                "                        <recordTime>1609430401224</recordTime>\n" +
                "                        <sourceDevice>1</sourceDevice>\n" +
                "                        <sourceDomain>eaaea1d210f44b1bb6ee25ad61045fd1</sourceDomain>\n" +
                "                    </commonInfo>\n" +
                "                    <extensionObjects>\n" +
                "                        <extensionField>\n" +
                "                            <value></value>\n" +
                "                        </extensionField>\n" +
                "                    </extensionObjects>\n" +
                "                    <pictureInfo>\n" +
                "                        <fileId>eaaea1d210f44b1bb6ee25ad61045fd1#4492335669245935621</fileId>\n" +
                "                        <picUrl>https://172.17.14.30:1190/mp_mcss/vcn-image.do?fileUuid=172.17.14.30-1189-2207375bfba242aca46cb161ee983e0d-MDIjMDAwMSOLMlOCKhN5r25lhER9ITeCm34o%252FJ5zRgPJ8lXcZCRDSTFuYURhUnJOc2lNZjZHUmZNUUd3PT0%253D</picUrl>\n" +
                "                        <pos>\n" +
                "                            <bottom>426</bottom>\n" +
                "                            <left>705</left>\n" +
                "                            <right>802</right>\n" +
                "                            <top>336</top>\n" +
                "                        </pos>\n" +
                "                        <quality>100</quality>\n" +
                "                        <thirdUrl></thirdUrl>\n" +
                "                        <thumPicUrl>https://172.17.14.30:1190/mp_mcss/vcn-image.do?fileUuid=172.17.14.30-1189-2207375bfba242aca46cb161ee983e0d-MDIjMDAwMSMRAolW26AHJIW4sZ8F4emMtt3cXIblDY%252BGIg3kgwAkcjZwckQ2TGtHcEFkL3N5d2NwYk1idz09</thumPicUrl>\n" +
                "                    </pictureInfo>\n" +
                "                    <faceAttributes>\n" +
                "                        <gImgCntId>027037311836946000000220210101000004205970616000</gImgCntId>\n" +
                "                        <mouthmask>0</mouthmask>\n" +
                "                    </faceAttributes>\n" +
                "                </face>\n" +
                "                <face>\n" +
                "                    <commonInfo>\n" +
                "                        <cameraCNCode>02703731184616460000</cameraCNCode>\n" +
                "                        <cameraName>172.21.4.29</cameraName>\n" +
                "                        <cameraSn>02703731184616460101#d43bf160787446258131d95e1173b418</cameraSn>\n" +
                "                        <domainCode>eaaea1d210f44b1bb6ee25ad61045fd1</domainCode>\n" +
                "                        <domainName>eaaea1d210f44b1bb6ee25ad61045fd1</domainName>\n" +
                "                        <historyFileId></historyFileId>\n" +
                "                        <latitude>0.0</latitude>\n" +
                "                        <longitude>0.0</longitude>\n" +
                "                        <recordTime>1609430401324</recordTime>\n" +
                "                        <sourceDevice>1</sourceDevice>\n" +
                "                        <sourceDomain>eaaea1d210f44b1bb6ee25ad61045fd1</sourceDomain>\n" +
                "                    </commonInfo>\n" +
                "                    <extensionObjects>\n" +
                "                        <extensionField>\n" +
                "                            <value></value>\n" +
                "                        </extensionField>\n" +
                "                    </extensionObjects>\n" +
                "                    <pictureInfo>\n" +
                "                        <fileId>eaaea1d210f44b1bb6ee25ad61045fd1#5753343564905480201</fileId>\n" +
                "                        <picUrl>https://172.17.14.30:1190/mp_mcss/vcn-image.do?fileUuid=172.17.14.30-1179-f31a27fce7e7477b858ff3d0bd3dd542-MDIjMDAwMSMo7%252F2pTTcL46tMOT6Fcg%252BFwyXGoUBOx%252BCkwvCewCRqbFFPakN3R1pZQTROclN0Q0ZNRUVBPT0%253D</picUrl>\n" +
                "                        <pos>\n" +
                "                            <bottom>143</bottom>\n" +
                "                            <left>713</left>\n" +
                "                            <right>790</right>\n" +
                "                            <top>54</top>\n" +
                "                        </pos>\n" +
                "                        <quality>100</quality>\n" +
                "                        <thirdUrl></thirdUrl>\n" +
                "                        <thumPicUrl>https://172.17.14.30:1190/mp_mcss/vcn-image.do?fileUuid=172.17.14.30-1179-f31a27fce7e7477b858ff3d0bd3dd542-MDIjMDAwMSM554YLO2IRt2TT12pi2LtS7pD%252B1jSy2wcZdsWefyRCclFoWkx1TFFzNXV2REdwb3JVOXVBPT0%253D</thumPicUrl>\n" +
                "                    </pictureInfo>\n" +
                "                    <faceAttributes>\n" +
                "                        <gImgCntId>027037311846164600000220210101000003205730616076</gImgCntId>\n" +
                "                        <mouthmask>1</mouthmask>\n" +
                "                    </faceAttributes>\n" +
                "                </face>\n" +
                "            </faces>\n" +
                "        </algorithmResult>\n" +
                "    </algorithmResults>\n" +
                "</response>";
        /*Vehicle vehicle1 = deserialize(xml,Vehicle.class);
        System.out.println(vehicle1.toString());*/
        System.out.println(myXml);
        Response response1 = deserialize(myXml,Response.class);
        System.out.println(response1);
    }

    public static <T> T deserialize(String xml,Class<T> clazz){
        XStream xStream = new XStream(new DomDriver());
        xStream.autodetectAnnotations(true);
        xStream.alias("response", clazz);
        T t = (T)xStream.fromXML(xml);
        return t;
    }

    public static <T> String serialize(T t){
        XStream xStream = new XStream(new DomDriver());
        xStream.autodetectAnnotations(true);
        String xml = xStream.toXML(t);
        return xml;
    }
}
